#include"shm.hpp"
using namespace bit;

int main()
{
    ReadShm s;
    std::cout << "key: ";
    PrintOnHEX(s.GetKey());
    std::cout << "shmid: ";
    std::cout << s.GetShmid() << std::endl;

    char* str = (char*)s.GetAddress();
    if(str == nullptr)std::cerr << "no address!!!" << std::endl;
    //服务端每隔2s读一下
    while(s.GetNattch() == 2)
    {
        std::cout << "shm memory content: " << str << std::endl;
        sleep(1);
    }
    return 0;
}